import HttpHandler from "@/handler/HttpHandler"
import {addParamsForPath} from '@/utils/xhrPathTurn'
export default class NeedToTaskApi {
  constructor() {
    this.http = new HttpHandler()
  }
  // 获取待办任务列表
  todoList(data){
    let url = '/workflow/task/todoList'
    return this.http.post(url, data)
  }
  // 获取角色列表
  roleList(data){
    let url = '/workflow/common/roleList'
    return this.http.get(url, data)
  }
  //获取角色下用户列表（分页）
  userListByRoleId(data){
    let url = '/workflow/common/userListByRoleId'
    return this.http.get(url, data)
  }
  // 委托任务
  entrust(data){
    let url = '/workflow/task/entrust'
    return this.http.post(url, data)
  }
  // 申请任务详情
  detail(data){
    let url = '/workflow/leave/detail'
    return this.http.post(url, data)
  }
  // 流程任务详情
  viewTaskDetail(data){
    let url = '/workflow/task/viewTaskDetail'
    return this.http.post(addParamsForPath(url, data))
  }
  // 审批任务
  doneTask(data){
    let url = '/workflow/task/doneTask'
    return this.http.post(url, data)
  }
}
